/**
 * 
 */
package org.cuatrovientos.methods2;

import java.util.Random;

/**
 * @author PC
 *
 */
public class MethodsExercise2 {

	/**
	 * @param args
	 */
	
	public static void showAll (int [] myArray) {
		for (int i = 0; i < myArray.length; i++) {
			System.out.println( i + ": " + myArray[1]);
		}
	}
	
	/**
	 * 
	 * @param args
	 */
	
	public static void initWithNumber ( int[] myArray, int number) {
		for (int i = 0; i < myArray.length; i++) {
			myArray[i] = number;
		}
	}
	
	/**
	 * 
	 * @param miArray
	 * @return
	 */
	public static int randomNumber(int[] myArray){
		Random random = new Random(10);
		int result = 0;
		result = myArray[random.nextInt(10)];
		return result;
	}
	
	/**
	 * 
	 */
	public static int pares (int[] myArray){
		int pares = 0;
		for( int i = 0;i<myArray.length;i++){
			if( myArray[i] % 2 == 0) {
				pares = pares + 1;
			}
			
		}
		System.out.println("pares: " + pares);
		return pares;
	}
	
	/**
	 * 
	 * @param args
	 */
	
	public static void main(String[] args) {
		int [] numbers = new int[15];
		Random random = new Random();
		int aNumber = random.nextInt(10);
		showAll(numbers);
		initWithNumber(numbers, aNumber);
		showAll(numbers);
	}

}
